from django.contrib import admin
from import_export.admin import ImportExportModelAdmin

from hema.models import *
import datetime
import xlwt
from django.http import FileResponse

from hema.resource import DataResource

admin.site.site_header = '盒马集市数据管理后台'  # 设置header
admin.site.site_title = '盒马集市数据管理后台'  # 设置title
admin.site.index_title = '盒马集市数据管理后台'


# Register your models here.
# class newData(admin.ModelAdmin):
class newData(ImportExportModelAdmin):
    """
    Data类继承
    """
    list_display = ['place', 'classname', 'title', 'cell', 'price', 'sku', 'time']
    list_per_page = 100
    list_filter = ['place', 'classname', 'time']
    search_fields = ['title', 'place']

    resource_class = DataResource


admin.site.register(Data, newData)
admin.site.register(City)
